<link rel="stylesheet" href="/static/style.css">
<title>{{ cve_id }} - {{ issue.description|truncate(50) }}</title>
<h1>{{ cve_id }} - {{ issue.description|truncate(50) }}</h1>
<h2>Summary</h2>
<p>{{ issue.description }}</p>
{% if issue.advisory %}
<h2>Advisory</h2>
<p>{{ issue.advisory }}</p>
{% endif %}
<table>
  {% if issue.references %}
  <tr>
    <th scope="row">References</th>
    <td/>
    <td>
      {% for url in issue.references %}
      <a href="{{ url }}">{{ url|urlabbrev }}</a>
      {% if not loop.last %}|{% endif %}
      {% endfor %}
    </td>
  </tr>
  {% endif %}
  {% if issue.aliases %}
  <tr>
    <th scope="row">Aliases</th>
    <td/>
    <td>
      {% for alias in issue.aliases %}
      {{ alias }}{% if not loop.last %},{% endif %}  
      {% endfor %}
    </td>
  </tr>
  {% endif %}
  {% if issue.comments %}
  <tr>
    <th scope="row" rowspan={{ issue.comments|length }}>Comments</th>
    {% for handle in issue.comments %}
    <th scope="row">
      {{ handle }}
    </th>
    <td>
      <pre>{{ issue.comments[handle] | linkify }}</pre>
    </td>
    {% if not loop.last %}
  </tr>
  <tr>
    {% endif %}
    {% endfor %}
  </tr>
  {% endif %}
  {% if issue.reporters %}
  <tr>
    <th scope="row">Reporters</th>
    <td/>
    <td>
      {% for rep in issue.reporters %}
      {# This may include an email address which could be linked #}
      {{ rep }}{% if not loop.last %},{% endif %}
      {% endfor %}
    </td>
  </tr>
  {% endif %}
  {% if issue['embargo-end'] %}
  <tr>
    <th scope="row">Embargo</th>
    <td/>
    <td>
      {# TODO: If embargo-end is in the future we should prominently
      flag this issue as embargoed #}
      {{ issue['embargo-end'] }}
    </td>
  </tr>
  {% endif %}
  <tr>
    <th scope="row" rowspan={{ branches|length }}>Status</th>
    {% for branch, affected in branches %}
    {% set name = branch.short_name %}
    <th scope="row">
      <a href="/branch/{{ name | urlencode | replace('/', '%2F') }}/">{{ name }}</a>
    </th>
    <td>
      {% if not affected %}
      {% if issue['fixed-by'] and issue['fixed-by'][name] and issue['fixed-by'][name] != 'never' %}
      <span class="good">fixed</span> by
      {% for change in issue['fixed-by'][name] %}
      <a href="{{ change | change_url(branch) }}">{{ change | change_abbrev }}</a>{% if not loop.last %},{% endif %}
      {% endfor %}
      {% else %}
      <span class="good">never affected</span>
      {% endif %}
      {% else %}
      {% if issue.ignore and (issue.ignore.all or issue.ignore[name]) %}
      <span class="ignored">ignored</span> ({{ issue.ignore.all or issue.ignore[name] }})
      {% else %}
      <span class="bad">vulnerable</span>
      {% endif %}
      {% if issue['introduced-by'] and issue['introduced-by'][name] and issue['introduced-by'][name] != 'never' %}
      - introduced by
      {% for change in issue['introduced-by'][name] %}
      <a href="{{ change | change_url(branch) }}">{{ change | change_abbrev }}</a>{% if not loop.last %},{% endif %}
      {% endfor %}
      {% endif %}
      {% endif %}
    </td>
    {% if not loop.last %}
  </tr>
  <tr>
    {% endif %}
    {% endfor %}
  </tr>
  {% if issue['fix-depends-on'] %}
  <tr>
    <th scope="row">Fix depends on</th>
    <td/>
    <td>
      {% for commit in issue['fix-depends-on'] %}
      <a href="https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit?id={{ commit }}">{{ commit[:12] }}</a>
      ({{ issue['fix-depends-on'][commit] }})
      {% if not loop.last %}<br/>{% endif %}
      {% endfor %}
    </td>
  </tr>
  {% endif %}
</table>
